package com.idata.controller;

import com.idata.common.constant.Result;
import com.idata.model.request.RelationRequest;
import com.idata.model.response.RelationResponse;
import com.idata.service.services.RelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RelationController {

    @Autowired
    private RelationService relationService;

    @PostMapping("/relation")
    @ResponseBody
    public Result<RelationResponse> relation(@RequestBody RelationRequest relationRequest) {
        RelationResponse res = relationService.relation(relationRequest);
        return Result.success(res);
    }
}
